/*******************************************************************************
 * Size: 18 px
 * Bpp: 1
 * Opts: --bpp 1 --size 18 --no-compress --font bb4171.ttf --symbols 风扇状态:ONFF温度湿强℃-RH一二三档.1234567890 --format lvgl -o syht_font_18.c
 ******************************************************************************/

#ifdef LV_LVGL_H_INCLUDE_SIMPLE
#include "lvgl.h"
#else
#include "../../LVGL/lvgl.h"
#endif

#ifndef SYHT_FONT_18
#define SYHT_FONT_18 1
#endif

#if SYHT_FONT_18

/*-----------------
 *    BITMAPS
 *----------------*/

/*Store the image of the glyphs*/
static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = {
    /* U+002D "-" */
    0xff, 0xc0,

    /* U+002E "." */
    0xff, 0x80,

    /* U+0030 "0" */
    0x3e, 0x3f, 0x9d, 0xdc, 0x7e, 0x3f, 0x1f, 0x8f,
    0xc7, 0xe3, 0xf1, 0xdd, 0xcf, 0xe3, 0xe0,

    /* U+0031 "1" */
    0x1c, 0xfc, 0xfc, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c,
    0x1c, 0x1c, 0x1c, 0xff, 0xff,

    /* U+0032 "2" */
    0x3e, 0x7f, 0xb1, 0xe0, 0x70, 0x38, 0x1c, 0x1c,
    0x1e, 0x1e, 0x1e, 0x1e, 0x1f, 0xff, 0xf8,

    /* U+0033 "3" */
    0x3e, 0x3f, 0xd8, 0xe0, 0x70, 0x78, 0xf0, 0x78,
    0xf, 0x3, 0x81, 0xd1, 0xff, 0xe3, 0xe0,

    /* U+0034 "4" */
    0xf, 0x3, 0xc1, 0xf0, 0xfc, 0x37, 0x1d, 0xc6,
    0x73, 0x9c, 0xff, 0xff, 0xf0, 0x70, 0x1c, 0x7,
    0x0,

    /* U+0035 "5" */
    0x7f, 0x3f, 0x98, 0xc, 0x7, 0xe3, 0xf8, 0x1e,
    0x7, 0x3, 0x81, 0xf1, 0xff, 0xe3, 0xc0,

    /* U+0036 "6" */
    0x1e, 0x1f, 0xdc, 0x5c, 0xe, 0x7, 0x73, 0xfd,
    0xc7, 0xc3, 0xe1, 0xd9, 0xef, 0xe1, 0xe0,

    /* U+0037 "7" */
    0xff, 0xff, 0xc1, 0xc0, 0xc0, 0xe0, 0x60, 0x70,
    0x38, 0x38, 0x1c, 0xe, 0x7, 0x3, 0x80,

    /* U+0038 "8" */
    0x3c, 0x3f, 0x38, 0xdc, 0x6e, 0x33, 0xf0, 0x78,
    0xce, 0xe3, 0xf1, 0xf8, 0xef, 0xe3, 0xe0,

    /* U+0039 "9" */
    0x3c, 0x3f, 0xbc, 0xdc, 0x3e, 0x1f, 0x1d, 0xfe,
    0x77, 0x3, 0x83, 0x91, 0xdf, 0xc3, 0xc0,

    /* U+003A ":" */
    0xff, 0x80, 0x7, 0xfc,

    /* U+0046 "F" */
    0xff, 0xff, 0xe0, 0xe0, 0xe0, 0xe0, 0xff, 0xff,
    0xe0, 0xe0, 0xe0, 0xe0, 0xe0,

    /* U+0048 "H" */
    0xe0, 0xfc, 0x1f, 0x83, 0xf0, 0x7e, 0xf, 0xff,
    0xff, 0xff, 0x7, 0xe0, 0xfc, 0x1f, 0x83, 0xf0,
    0x7e, 0xe,

    /* U+004E "N" */
    0xe1, 0xfc, 0x7f, 0x1f, 0xe7, 0xf9, 0xfb, 0x7e,
    0xdf, 0x97, 0xe7, 0xf9, 0xfe, 0x3f, 0x8f, 0xe1,
    0xc0,

    /* U+004F "O" */
    0x1f, 0x83, 0xfc, 0x71, 0xef, 0xe, 0xe0, 0x7e,
    0x7, 0xe0, 0x7e, 0x7, 0xe0, 0x77, 0xe, 0x79,
    0xe3, 0xfc, 0x1f, 0x80,

    /* U+0052 "R" */
    0xff, 0x1f, 0xf3, 0x8f, 0x70, 0xee, 0x1d, 0xc7,
    0xbf, 0xe7, 0xf0, 0xe7, 0x1c, 0xe3, 0x8e, 0x71,
    0xee, 0x1c,

    /* U+2103 "℃" */
    0x70, 0x3e, 0x44, 0x7f, 0xa2, 0x78, 0xd1, 0x38,
    0x7, 0x38, 0x0, 0x1c, 0x0, 0xe, 0x0, 0x7,
    0x0, 0x3, 0x80, 0x0, 0xe0, 0x0, 0x78, 0xc0,
    0x1f, 0xe0, 0x3, 0xe0,

    /* U+4E00 "一" */
    0xff, 0xff, 0xff, 0xff, 0xc0,

    /* U+4E09 "三" */
    0x7f, 0xfe, 0x7f, 0xfe, 0x0, 0x0, 0x0, 0x0,
    0x0, 0x0, 0x3f, 0xfc, 0x3f, 0xfc, 0x0, 0x0,
    0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
    0xff, 0xff,

    /* U+4E8C "二" */
    0x7f, 0xfe, 0x7f, 0xfe, 0x0, 0x0, 0x0, 0x0,
    0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
    0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
    0xff, 0xff,

    /* U+5EA6 "度" */
    0x0, 0x0, 0x0, 0x30, 0xf, 0xff, 0xe7, 0xff,
    0xf3, 0x0, 0x1, 0x8c, 0x60, 0xff, 0xfe, 0x63,
    0x18, 0x31, 0xfc, 0x18, 0xfe, 0xc, 0x0, 0x7,
    0xff, 0xe3, 0x38, 0xe3, 0xf, 0xe1, 0x87, 0xf0,
    0xdf, 0xff, 0xc, 0x3, 0x0,

    /* U+5F3A "强" */
    0xfd, 0xfe, 0x7e, 0xff, 0x3, 0x61, 0x81, 0xb0,
    0xc7, 0xdf, 0xe3, 0xe1, 0x81, 0xf0, 0xc1, 0x83,
    0xfe, 0xc1, 0xb3, 0x7e, 0xd9, 0xbf, 0x6c, 0xc1,
    0xbf, 0xe0, 0xc3, 0x60, 0x61, 0x98, 0x3f, 0xfe,
    0xff, 0xff, 0x38, 0x1, 0x0,

    /* U+6001 "态" */
    0x1, 0x80, 0x1, 0x80, 0xff, 0xff, 0xff, 0xff,
    0x3, 0xe0, 0x7, 0x60, 0xe, 0x70, 0x1d, 0x3c,
    0x7f, 0xdf, 0xf1, 0xcf, 0x41, 0x82, 0x6d, 0x8c,
    0x6c, 0xc6, 0x6c, 0xde, 0xec, 0x1b, 0xcf, 0xfb,
    0x47, 0xf0,

    /* U+6247 "扇" */
    0x0, 0x40, 0x0, 0xc0, 0x3f, 0xfe, 0x3f, 0xfe,
    0x30, 0x6, 0x30, 0x6, 0x3f, 0xfe, 0x3f, 0xfe,
    0x30, 0x0, 0x37, 0xff, 0x30, 0xc3, 0x36, 0xdb,
    0x33, 0xdb, 0x72, 0xc7, 0x67, 0xdf, 0x6f, 0xfb,
    0x6c, 0xd3, 0x61, 0xc6,

    /* U+6863 "档" */
    0x18, 0x18, 0xc, 0xcc, 0xc6, 0x36, 0x6f, 0xdb,
    0x67, 0xed, 0xb0, 0xc0, 0xc0, 0xf7, 0xfe, 0x7f,
    0xff, 0x3e, 0x1, 0xbd, 0x0, 0xde, 0x3f, 0xfb,
    0x1f, 0xf5, 0x80, 0x18, 0xc0, 0xc, 0x67, 0xfe,
    0x33, 0xff, 0x18, 0x1, 0x80,

    /* U+6E29 "温" */
    0x0, 0x0, 0x39, 0xff, 0x1e, 0xff, 0x83, 0x60,
    0xc0, 0x30, 0x60, 0x1f, 0xf3, 0xc, 0x19, 0xe7,
    0xfc, 0x33, 0xfe, 0x0, 0x0, 0x1, 0xff, 0xc2,
    0xff, 0xe3, 0x6d, 0xb3, 0xb6, 0xd9, 0x9b, 0x6d,
    0xdf, 0xff, 0x4f, 0xff, 0x80,

    /* U+6E7F "湿" */
    0x0, 0x0, 0x39, 0xff, 0x9e, 0xff, 0xc2, 0x60,
    0x60, 0x30, 0x30, 0x1f, 0xfb, 0x8c, 0xd, 0xe7,
    0xfe, 0x23, 0xff, 0x0, 0x6c, 0x9, 0xb6, 0x66,
    0xdb, 0x63, 0x3d, 0xb3, 0x1e, 0xf1, 0x83, 0x61,
    0xdf, 0xff, 0x4f, 0xff, 0x80,

    /* U+72B6 "状" */
    0x18, 0x64, 0x18, 0x6c, 0x18, 0x66, 0xd8, 0x66,
    0xf8, 0x60, 0x7f, 0xff, 0x5f, 0xff, 0x18, 0x60,
    0x18, 0x70, 0x38, 0xf0, 0xf8, 0xf0, 0xd8, 0xd8,
    0x99, 0xdc, 0x19, 0x8c, 0x1b, 0x8e, 0x1f, 0x7,
    0x1a, 0x2,

    /* U+98CE "风" */
    0x3f, 0xfc, 0x3f, 0xfc, 0x30, 0xc, 0x30, 0x6c,
    0x34, 0x6c, 0x36, 0x6c, 0x37, 0xec, 0x33, 0xcc,
    0x31, 0xcc, 0x31, 0xcc, 0x33, 0xcc, 0x77, 0xec,
    0x66, 0x6c, 0x6e, 0x7d, 0x6c, 0x25, 0xe0, 0x7,
    0x40, 0x3
};


/*---------------------
 *  GLYPH DESCRIPTION
 *--------------------*/

static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = {
    {.bitmap_index = 0, .adv_w = 0, .box_w = 0, .box_h = 0, .ofs_x = 0, .ofs_y = 0} /* id = 0 reserved */,
    {.bitmap_index = 0, .adv_w = 107, .box_w = 5, .box_h = 2, .ofs_x = 1, .ofs_y = 4},
    {.bitmap_index = 2, .adv_w = 94, .box_w = 3, .box_h = 3, .ofs_x = 1, .ofs_y = 0},
    {.bitmap_index = 4, .adv_w = 170, .box_w = 9, .box_h = 13, .ofs_x = 1, .ofs_y = 0},
    {.bitmap_index = 19, .adv_w = 170, .box_w = 8, .box_h = 13, .ofs_x = 1, .ofs_y = 0},
    {.bitmap_index = 32, .adv_w = 170, .box_w = 9, .box_h = 13, .ofs_x = 1, .ofs_y = 0},
    {.bitmap_index = 47, .adv_w = 170, .box_w = 9, .box_h = 13, .ofs_x = 0, .ofs_y = 0},
    {.bitmap_index = 62, .adv_w = 170, .box_w = 10, .box_h = 13, .ofs_x = 1, .ofs_y = 0},
    {.bitmap_index = 79, .adv_w = 170, .box_w = 9, .box_h = 13, .ofs_x = 1, .ofs_y = 0},
    {.bitmap_index = 94, .adv_w = 170, .box_w = 9, .box_h = 13, .ofs_x = 1, .ofs_y = 0},
    {.bitmap_index = 109, .adv_w = 170, .box_w = 9, .box_h = 13, .ofs_x = 1, .ofs_y = 0},
    {.bitmap_index = 124, .adv_w = 170, .box_w = 9, .box_h = 13, .ofs_x = 1, .ofs_y = 0},
    {.bitmap_index = 139, .adv_w = 170, .box_w = 9, .box_h = 13, .ofs_x = 1, .ofs_y = 0},
    {.bitmap_index = 154, .adv_w = 94, .box_w = 3, .box_h = 10, .ofs_x = 1, .ofs_y = 0},
    {.bitmap_index = 158, .adv_w = 168, .box_w = 8, .box_h = 13, .ofs_x = 2, .ofs_y = 0},
    {.bitmap_index = 171, .adv_w = 218, .box_w = 11, .box_h = 13, .ofs_x = 2, .ofs_y = 0},
    {.bitmap_index = 189, .adv_w = 216, .box_w = 10, .box_h = 13, .ofs_x = 2, .ofs_y = 0},
    {.bitmap_index = 206, .adv_w = 222, .box_w = 12, .box_h = 13, .ofs_x = 1, .ofs_y = 0},
    {.bitmap_index = 226, .adv_w = 196, .box_w = 11, .box_h = 13, .ofs_x = 2, .ofs_y = 0},
    {.bitmap_index = 244, .adv_w = 288, .box_w = 17, .box_h = 13, .ofs_x = 1, .ofs_y = 0},
    {.bitmap_index = 272, .adv_w = 288, .box_w = 17, .box_h = 2, .ofs_x = 0, .ofs_y = 6},
    {.bitmap_index = 277, .adv_w = 288, .box_w = 16, .box_h = 13, .ofs_x = 1, .ofs_y = 0},
    {.bitmap_index = 303, .adv_w = 288, .box_w = 16, .box_h = 13, .ofs_x = 1, .ofs_y = 0},
    {.bitmap_index = 329, .adv_w = 288, .box_w = 17, .box_h = 17, .ofs_x = 0, .ofs_y = -1},
    {.bitmap_index = 366, .adv_w = 288, .box_w = 17, .box_h = 17, .ofs_x = 1, .ofs_y = -2},
    {.bitmap_index = 403, .adv_w = 288, .box_w = 16, .box_h = 17, .ofs_x = 1, .ofs_y = -2},
    {.bitmap_index = 437, .adv_w = 288, .box_w = 16, .box_h = 18, .ofs_x = 0, .ofs_y = -2},
    {.bitmap_index = 473, .adv_w = 288, .box_w = 17, .box_h = 17, .ofs_x = 0, .ofs_y = -2},
    {.bitmap_index = 510, .adv_w = 288, .box_w = 17, .box_h = 17, .ofs_x = 1, .ofs_y = -1},
    {.bitmap_index = 547, .adv_w = 288, .box_w = 17, .box_h = 17, .ofs_x = 1, .ofs_y = -1},
    {.bitmap_index = 584, .adv_w = 288, .box_w = 16, .box_h = 17, .ofs_x = 1, .ofs_y = -2},
    {.bitmap_index = 618, .adv_w = 288, .box_w = 16, .box_h = 17, .ofs_x = 1, .ofs_y = -2}
};

/*---------------------
 *  CHARACTER MAPPING
 *--------------------*/

static const uint16_t unicode_list_0[] = {
    0x0, 0x1, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
    0x9, 0xa, 0xb, 0xc, 0xd, 0x19, 0x1b, 0x21,
    0x22, 0x25, 0x20d6, 0x4dd3, 0x4ddc, 0x4e5f, 0x5e79, 0x5f0d,
    0x5fd4, 0x621a, 0x6836, 0x6dfc, 0x6e52, 0x7289, 0x98a1
};

/*Collect the unicode lists and glyph_id offsets*/
static const lv_font_fmt_txt_cmap_t cmaps[] =
{
    {
        .range_start = 45, .range_length = 39074, .glyph_id_start = 1,
        .unicode_list = unicode_list_0, .glyph_id_ofs_list = NULL, .list_length = 31, .type = LV_FONT_FMT_TXT_CMAP_SPARSE_TINY
    }
};

/*-----------------
 *    KERNING
 *----------------*/


/*Pair left and right glyphs for kerning*/
static const uint8_t kern_pair_glyph_ids[] =
{
    14, 2,
    14, 17,
    18, 1
};

/* Kerning between the respective left and right glyphs
 * 4.4 format which needs to scaled with `kern_scale`*/
static const int8_t kern_pair_values[] =
{
    -29, -3, -10
};

/*Collect the kern pair's data in one place*/
static const lv_font_fmt_txt_kern_pair_t kern_pairs =
{
    .glyph_ids = kern_pair_glyph_ids,
    .values = kern_pair_values,
    .pair_cnt = 3,
    .glyph_ids_size = 0
};

/*--------------------
 *  ALL CUSTOM DATA
 *--------------------*/

#if LVGL_VERSION_MAJOR == 8
/*Store all the custom data of the font*/
static  lv_font_fmt_txt_glyph_cache_t cache;
#endif

#if LVGL_VERSION_MAJOR >= 8
static const lv_font_fmt_txt_dsc_t font_dsc = {
#else
static lv_font_fmt_txt_dsc_t font_dsc = {
#endif
    .glyph_bitmap = glyph_bitmap,
    .glyph_dsc = glyph_dsc,
    .cmaps = cmaps,
    .kern_dsc = &kern_pairs,
    .kern_scale = 16,
    .cmap_num = 1,
    .bpp = 1,
    .kern_classes = 0,
    .bitmap_format = 0,
#if LVGL_VERSION_MAJOR == 8
    .cache = &cache
#endif
};



/*-----------------
 *  PUBLIC FONT
 *----------------*/

/*Initialize a public general font descriptor*/
#if LVGL_VERSION_MAJOR >= 8
const lv_font_t syht_font_18 = {
#else
lv_font_t syht_font_18 = {
#endif
    .get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt,    /*Function pointer to get glyph's data*/
    .get_glyph_bitmap = lv_font_get_bitmap_fmt_txt,    /*Function pointer to get glyph's bitmap*/
    .line_height = 18,          /*The maximum line height required by the font*/
    .base_line = 2,             /*Baseline measured from the bottom of the line*/
#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0)
    .subpx = LV_FONT_SUBPX_NONE,
#endif
#if LV_VERSION_CHECK(7, 4, 0) || LVGL_VERSION_MAJOR >= 8
    .underline_position = -2,
    .underline_thickness = 1,
#endif
    .dsc = &font_dsc,          /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
#if LV_VERSION_CHECK(8, 2, 0) || LVGL_VERSION_MAJOR >= 9
    .fallback = NULL,
#endif
};



#endif /*#if SYHT_FONT_18*/

